<div>
    <table id="list" #tablelist>
        <thead>
            <tr>
                <th>姓名</th>
                <th>性别</th>
                <th>年龄</th>
            </tr>
        </thead>
        <tbody>
            <tr *ngFor="let item of data">
                <td> {{ item.name }}</td>
                <td> {{ item.gender }}</td>
                <td> {{ item.age }}</td>
            </tr>
        </tbody>
    </table>
    <button (click)="onPrint()">预览</button>
</div>